#!/usr/bin/env python3
import socket
import itertools
import sys
import time

from dm_reg import *
from dm_utils import *
from openocd import *

if __name__ == "__main__":
    with OpenOcd() as ocd:
        for i in range(0, 4):
            ocd.send("riscv dmi_write 0x42 {}" % i)
            print("hart " + i + ": " + ocd.send("riscv dmi_read 0x4b"))
